package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class FISDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("./test.dat");
        /*
            int read()
            读取1个字节，并将该字节的2进制保存在返回的int值
         */
        int d = fis.read();//1
        System.out.println(d);

        d = fis.read();//12
        System.out.println(d);
        /*
          00000000 00000000 00000000 00000001
          00000000 00000000 00000000 00000010
         */
        d = fis.read();//-1
        System.out.println(d);

        fis.close();

    }
}
